<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title>Favorite fruit start</title>
    <style>
        input:invalid {
            border: 2px dashed red;
        }

        input:invalid:required {
            background-image: linear-gradient(to right, pink, lightgreen);
        }

        input:valid {
            border: 2px solid black;
        }
    </style>
</head>

<body>
    <form>
        <label for="choose">Would you prefer a banana or a cherry?</label>
        <input id="choose" name="i_like" required>
        <button>Submit</button>
    </form>
</body>

</html>